
package com.showcai.controller.feedBack;

import com.github.pagehelper.PageInfo;
import com.showcai.controller.base.BaseController;
import com.showcai.def.Constant;
import com.showcai.module.FeedBack;
import com.showcai.service.FeedBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * Created by lutao on 2017/7/14.
 */
@RequestMapping("/feedbback")
@Controller
public class FeedBackController extends BaseController {

    @Autowired
    FeedBackService feedBackService;

    /**
     * 获取意见反馈
     * @return
     */
    @RequestMapping(value = "/feedbackList")
    @ResponseBody
    public ModelAndView feeBackList(Integer page, Integer pageSize) {
        logger.info("feedback==================================>>>>>>");
        ModelAndView mov = new ModelAndView();
        if (page == null || page == 0) {
            page = Constant.PAGENUM;
        }
        // 设置每页记录数
        if (pageSize == null || pageSize == 0) {
            pageSize = Constant.PAGESIZENum;
        }
        PageInfo<FeedBack> pageInfo = feedBackService.getFeedBackList(page,pageSize);
        mov.setViewName("/feedBack/feedBackList");
        mov.addObject("pageInfo",pageInfo);
        return mov;
    }



}
